package vip.xiaonuo.biz.modular.watchtask.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import vip.xiaonuo.biz.modular.watchtask.entity.TaskAssignment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import vip.xiaonuo.biz.modular.watchtask.result.TaskAssigmentUser;

/**
 * 任务申请表(TaskAssignment)表数据库访问层
 *
 * @author h
 * @since 2025-11-19 15:06:08
 */
@Mapper
public interface TaskAssignmentMapper extends BaseMapper<TaskAssignment>{
    /**
     * 分页查询任务申请信息表
     * @param page
     * @param queryWrapper
     * @return
     */
    @Select("select t1.*,\n" +
            "t2.nick_name applet_user_name,\n" +
            "t2.create_time register_time,\n" +
            "t3.id platform_user_id,\n" +
            "t3.name platform_user_name\n" +
            "from tb_task_assignment t1 inner join tb_applet_user t2 on t1.applet_user_id=t2.user_id\n" +
            "left join SYS_USER t3 on t2.platform_user_id=t3.ID ${ew.customSqlSegment}")
    Page<TaskAssigmentUser> pageTaskAssigment(Page<TaskAssigmentUser> page, @Param("ew") Wrapper queryWrapper);
}
